package com.gitee.zhanyao.codebase.java.cloud.servera.controller;

import com.gitee.zhanyao.codebase.java.cloud.servera.feignclient.ServerBAPIClient;
import com.gitee.zhanyao.codebase.java.cloud.servera.feignclient.ServerBClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanyao
 */
@RestController
public class HelloController {

    @Autowired
    private ServerBClient serverBClient;

    @Autowired
    private ServerBAPIClient serverBAPIClient;

    @GetMapping("/sayHello")
    public String sayHello() {
        return "hello Server A!";
    }

    @GetMapping("/sayServerBHello")
    public String sayServerBHello() {
        return serverBClient.sayHello();
    }

    @GetMapping("/sayServerBAPIHello")
    public String sayServerBAPIHello() {
        return serverBAPIClient.say();
    }

}